<extend name="Base:base" />
<block name="base_main">
	<link rel="stylesheet" href="__PUBLIC__/seller/css/validform.css" />
	<script src="__PUBLIC__/seller/js/Validform_v5.3.2.js"></script>
	<style>
		body{ background:#fff }
	</style>
	<div class="tpl-block ">
		<div class="am-g tpl-amazeui-form">
			<div class="am-u-sm-12 am-u-md-9">
				<form class="am-form am-form-horizontal" request_type="parent" ignoreHidden="ignoreHidden" ajaxPost action="" name="myfromSubmit" method="post">
					<div class="am-form-group">
						<label for="user-email" class="am-u-sm-3 am-form-label">账户类型</label>
						<input type="hidden" value="{$data.id}" name="poster[id]" />
						<div class="am-u-sm-6 float_left">
							<span>
								<select name="poster[type]" id="type" datatype="*" nullmsg="请选择要提现账户的类型">
									<option value="">请选择账户类型</option>
									<option value="1" <eq name="data.type" value="1">selected</eq>>支付宝</option>
									<option value="2" <eq name="data.type" value="2">selected</eq>>微信</option>
									<option value="3" <eq name="data.type" value="3">selected</eq>>银行卡</option>
								</select>
							</span>
						</div>
					</div>
					<div class="am-form-group" id="bank_name" <?php if( in_array( $data['type'],array(1,2))) { echo "style='display:none'"; } ?>>
						<label for="user-email" class="am-u-sm-3 am-form-label">银行名</label>
						<div class="am-u-sm-5 float_left">
							<span><input type="text"  name="poster[account_name]" datatype="*" nullmsg="银行名称不能为空" value="{$data.account_name}" placeholder="银行名称"></span>
							<span><small>例如：中国银行 / 建设银行</small></span>
						</div>
					</div>
					<div class="am-form-group">
						<label for="user-email" class="am-u-sm-3 am-form-label">提现账户</label>
						<div class="am-u-sm-7 float_left">
							<span><input type="text"   name="poster[account_no]" datatype="*" nullmsg="提现账户不能为空" value="{$data.account_no}" placeholder="提现账户号"></span>
							<span><small>注意：微信/支付宝填写账号，银行卡填写卡号。</small></span>
						</div>
					</div>
					<div class="am-form-group" id="corporation" <?php if( in_array( $data['type'],array(1,2))) { echo "style='display:none'"; } ?>>
						<label for="user-email" class="am-u-sm-3 am-form-label">银行户主</label>
						<div class="am-u-sm-5 float_left">
							<span><input type="text"  name="poster[corporation]" datatype="*" nullmsg="银行户主不能为空" value="{$data.corporation}" placeholder="银行户主"></span>
							<span><small>注意：这里需要输入银行开户户主</small></span>
						</div>
					</div>
					<div class="am-form-group">
						<div class="am-u-sm-6 float_left am-u-sm-push-3">
							<button type="submit" class="am-btn am-btn-primary">保存修改</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
	<script>
		$("#type").change(function(){
			var _obj = $('input[name="poster[account_name]"]');
			if( $(this).val() == 3 ) {
				$("#corporation").show();
				$("#bank_name").show();
				_obj.val('');
			} else {
				if( $(this).val() == 1 ) {
					_obj.val('支付宝');
				} else if( $(this).val() == 2 ) {
					_obj.val('微信');
				}
				$("#corporation").hide();
				$("#bank_name").hide();
			}
		});
		call_submit_back_flag = true;
		function call_submit_back_func() {
			parent.zeroModal.closeAll();
		}
	</script>
</block>